/*
 * calendario.h
 *
 *  Created on: 19 de Out de 2011
 *      Author: pedrocouto
 */

#ifndef CALENDARIO_H_
#define CALENDARIO_H_

#include <string>
#include <vector>
#include <iostream>
#include "espetaculo.h"

using std::string;
using std::vector;
using std::endl;
using std::ostream;

template <class N>
class DataInvalida{
public:
	N erro;
	DataInvalida(N e) {erro = e;}
};

template <class N>
std::ostream & operator<<(std::ostream & out, const DataInvalida<N> & erro){
	out << erro.erro <<" Invalido!"<< endl;
	return out;
};

class Data {
protected:
	int dia, mes, ano;
public:
	Data(int a, int m, int d);
	Data() {}
	~Data();
	int getDia() { return dia; }
	int getMes() { return mes; }
	int getAno() { return ano; }
	void setDia(int d) { dia = d; }
	void setMes(int m) { mes = m; }
	void setAno(int a) { ano = a; }

	std::ostream & operator <<(std::ostream & o);
	bool operator <(const Data &dt) const {
		if (ano < dt.ano)
				return true;
			else if (ano == dt.ano){
				if (mes < dt.mes)
					return true;
				else if(mes == dt.mes){
					if (dia < dia)
						return true;
				}
			}
			return false;
	}
};

#endif /* CALENDARIO_H_ */
